#include <iostream>
#include <string>
#include <vector>
using namespace std;


void moveZeroes(vector<int>& nums) {
    int zeroNum = 0;
    for (auto e : nums) {
        if (e == 0)
            zeroNum++;
    }
    int i = 0, j = 0;
    for (i = 0, j = 0; j < nums.size(); j++) {
        if (nums[j] != 0) {
            nums[i] = nums[j];
            i++;
        }
    }
    for (; i < nums.size(); i++) {
        nums[i] = 0;
    }
}

int main()
{
    vector<int> v{ 0,1,0,3,12 };
    moveZeroes(v);
    for (auto e : v) {
        cout << e << " ";
    }
    return 0;
}